package com.yzc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yzc.Dto.roleMenu;
import com.yzc.pojo.RoleBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<RoleBean> {

    @Select("select * from t_role where state = 0")
    List<RoleBean> loadRoleList();

    @Insert("insert into t_role (name,memo) values (#{name},#{memo})")
    void save(RoleBean roleBean);

    @Update("update t_role set name=#{name},memo=#{memo} where id = #{id}")
    void updateInfo(RoleBean roleBean);

    @Update("update t_role set state= 1 where id = #{id}")
    void deleteInfo(RoleBean roleBean);


    void deleteRoleMenu(RoleBean roleBean);


    void saveAuthorizationRoleMenu(RoleBean roleBean);


    List<roleMenu>  loadRoleMenus(RoleBean roleBean);
}
